<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>flex 布局 让子元素整体水平垂直居中</title>
    <style>
         div {
            display: flex;
            width: 800px;
            height: 400px;
            background-color: pink;
            /* 默认的主轴是x轴 row */
            justify-content: center;
            align-items: center;




            /* 1.沿着y轴上下移动 */
            /* align-items: flex-start; */
            /* 2.子元素无设置高度的情况下 根据父元素高度进行拉伸 了解即可 */
            /* align-items: stretch; */
         }

         span {
            width: 150px;
            height: 100px;
            background-color: skyblue;
            margin: 10px;
           }
    </style>
</head>
<body>
    <div>
        <span>1</span>
        <span>1</span>
        <span>1</span>
        <span>1</span>
    </div>
</body>
</html>